package com.itheima.controller;

import com.itheima.constant.TokenConstant;
import com.itheima.result.R;
import com.itheima.vo.ShoppingCartVo;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/shoppingCart")
public class ShoppingCartController {
    @Resource
    private RedisTemplate<Object, Object> redisTemplate;

    @GetMapping("/list")
    public R<ShoppingCartVo> getShoppingCartList(HttpServletRequest request) {
        String token = request.getHeader("Authorization");
        Object o = redisTemplate.opsForValue().get(TokenConstant.USER_TOKEN_PREFIX +token);
    }

}
